package GUI;

import PaymentModule.Cash;
import javax.swing.JOptionPane;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Nordahl
 */
public class PayDA extends javax.swing.JPanel {

    tvmGUI master;
    /**
     * Creates new form PayDA
     */
    public PayDA() {
        initComponents();
        //LabPayDATime.setText(master.time.toString().substring(0,19));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        LabPayDAInfo = new javax.swing.JLabel();
        LabPayDATime = new javax.swing.JLabel();
        LabPayDATitle = new javax.swing.JLabel();
        LabPayDAInstruct = new javax.swing.JLabel();
        ButPayDACash = new javax.swing.JButton();
        ButPayDACard = new javax.swing.JButton();
        ButPayDASMS = new javax.swing.JButton();
        ButPayDAClear = new javax.swing.JButton();
        ButPayDABack = new javax.swing.JButton();
        ButPayDAHelp = new javax.swing.JButton();

        setMinimumSize(new java.awt.Dimension(800, 600));

        LabPayDAInfo.setText(" ");

        LabPayDATime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        LabPayDATime.setText("  ");

        LabPayDATitle.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        LabPayDATitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        LabPayDATitle.setText("Betaling");

        LabPayDAInstruct.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        LabPayDAInstruct.setText("Vælg ønsket betalingsform.");

        ButPayDACash.setText("Kontant");
        ButPayDACash.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDACashActionPerformed(evt);
            }
        });

        ButPayDACard.setText("Betalingskort");
        ButPayDACard.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDACardActionPerformed(evt);
            }
        });

        ButPayDASMS.setText("SMS");
        ButPayDASMS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDASMSActionPerformed(evt);
            }
        });

        ButPayDAClear.setText("Afbryd");
        ButPayDAClear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDAClearActionPerformed(evt);
            }
        });

        ButPayDABack.setText("Tilbage");
        ButPayDABack.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDABackActionPerformed(evt);
            }
        });

        ButPayDAHelp.setText("?");
        ButPayDAHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ButPayDAHelpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(327, 327, 327)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(ButPayDASMS, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ButPayDACard, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ButPayDACash, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(300, 300, 300)
                                .addComponent(LabPayDATitle, javax.swing.GroupLayout.PREFERRED_SIZE, 199, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(246, 246, 246)
                                .addComponent(LabPayDAInstruct, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(ButPayDAHelp)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(ButPayDABack, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(57, 57, 57)
                                .addComponent(ButPayDAClear, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(LabPayDAInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 170, Short.MAX_VALUE)
                                .addComponent(LabPayDATime, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LabPayDAInfo)
                    .addComponent(LabPayDATime))
                .addGap(53, 53, 53)
                .addComponent(LabPayDATitle)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(LabPayDAInstruct)
                .addGap(39, 39, 39)
                .addComponent(ButPayDACash, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(41, 41, 41)
                .addComponent(ButPayDACard, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(43, 43, 43)
                .addComponent(ButPayDASMS, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 96, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(ButPayDAHelp, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                    .addComponent(ButPayDABack, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                    .addComponent(ButPayDAClear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void ButPayDACashActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDACashActionPerformed
        // New instance of Cash simulation
        master.CH = new Cash(master.SB.getTotalPrice());
        // Set labels
        //LabCashDAInfo.setText("Maskin ID: "+master.hardID+"  Zone: "+master.startZone);
        //LabCashDAMissing.setText("Mangler: "+master.SB.getTotalPrice()+" DKK");
        // Go to next window
        //switchWindow(PayDA, CashDA);
    }//GEN-LAST:event_ButPayDACashActionPerformed

    private void ButPayDACardActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDACardActionPerformed
        // NOT DONE!
        //PayDA.setVisible(false);
    }//GEN-LAST:event_ButPayDACardActionPerformed

    private void ButPayDASMSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDASMSActionPerformed
        // NOT DONE!
        //PayDA.setVisible(false);
    }//GEN-LAST:event_ButPayDASMSActionPerformed

    private void ButPayDAClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDAClearActionPerformed
        // Clear content of cart-array, list-array, and list
        //ListCartDATicketList.removeAll();
        master.CartContent.clear();
        master.SB.clearCart();
        // Reset selectionscreen's inputs
        //master.resetSelectionScreen();
        // Go back to welcomeing screen
        //switchWindow(PayDA, WelcomeDA);
    }//GEN-LAST:event_ButPayDAClearActionPerformed

    private void ButPayDABackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDABackActionPerformed
        // Go back to previous window
        //switchWindow(PayDA, CartDA);
    }//GEN-LAST:event_ButPayDABackActionPerformed

    private void ButPayDAHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ButPayDAHelpActionPerformed
        JOptionPane.showMessageDialog(this,
            "\nFor hjælp ring xx xx xx xx"
            + "\nFor teknisk assistance ring xx xx xx xx"
            + "\nHusk at oplyse maskinens ID, som kan findes i øvre venstre hjørne."
            + "\n"
            + "\nBlueJ Trakfikselskab","Hjælp og teknisk support",
            JOptionPane.INFORMATION_MESSAGE);
    }//GEN-LAST:event_ButPayDAHelpActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton ButPayDABack;
    private javax.swing.JButton ButPayDACard;
    private javax.swing.JButton ButPayDACash;
    private javax.swing.JButton ButPayDAClear;
    private javax.swing.JButton ButPayDAHelp;
    private javax.swing.JButton ButPayDASMS;
    private javax.swing.JLabel LabPayDAInfo;
    private javax.swing.JLabel LabPayDAInstruct;
    private javax.swing.JLabel LabPayDATime;
    private javax.swing.JLabel LabPayDATitle;
    // End of variables declaration//GEN-END:variables
}
